<!DOCTYPE HTML>
<html>
<head>
    <title>微信支付</title>
    <meta name="viewport"
          content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
</head>
<body>
<script src="/js/jquery.js"></script>
<script type="text/javascript">
    $(function () {
        pay();
    });

    function pay() {
        // 判断是否是微信浏览器 是微信浏览器走公众号支付 普通浏览器走H5支付
        gzhpay();
    }

    function gzhpay() {
        var url = "http://isparking.cn/wx/gzhpay"; // 注意此处的basePath是没有端口号的域名地址。如果包含:80,在提交给微信时有可能会提示
        // “redirect_uri参数错误”
        // money为订单需要支付的金额
        // state中存放的为商品订单号
        console.log(url);
        var weixinUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxeae418507d27aeeb&redirect_uri=" + encodeURI(url) + "&response_type=code&scope=snsapi_base#wechat_redirect";
        window.location.href = encodeURI(weixinUrl);
    }

</script>
</body>

</html>